using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._TileCache
{
    /// <summary>
    /// <para>Import Tile Cache</para>
    /// <para>Imports tiles from an existing tile cache or a tile package. The target cache must have the same tiling scheme, spatial reference, and  storage format as the source tile cache.</para>
    /// <para>从现有切片缓存或切片包导入切片。目标缓存必须具有与源切片缓存相同的切片方案、空间参考和存储格式。</para>
    /// </summary>    
    [DisplayName("Import Tile Cache")]
    public class ImportTileCache : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ImportTileCache()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_cache_target">
        /// <para>Target Tile Cache</para>
        /// <para>An existing tile cache to which the tiles will be imported.</para>
        /// <para>将切片导入到的现有切片缓存。</para>
        /// </param>
        /// <param name="_in_cache_source">
        /// <para>Source Tile Cache</para>
        /// <para>An existing tile cache or a tile package from which the tiles are imported.</para>
        /// <para>从中导入切片的现有切片缓存或切片包。</para>
        /// </param>
        public ImportTileCache(object _in_cache_target, object _in_cache_source)
        {
            this._in_cache_target = _in_cache_target;
            this._in_cache_source = _in_cache_source;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Import Tile Cache";

        public override string CallName => "management.ImportTileCache";

        public override List<string> AcceptEnvironments => ["parallelProcessingFactor"];

        public override object[] ParameterInfo => [_in_cache_target, _in_cache_source, _scales, _area_of_interest, _overwrite.GetGPValue(), _out_tile_cache];

        /// <summary>
        /// <para>Target Tile Cache</para>
        /// <para>An existing tile cache to which the tiles will be imported.</para>
        /// <para>将切片导入到的现有切片缓存。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Target Tile Cache")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_cache_target { get; set; }


        /// <summary>
        /// <para>Source Tile Cache</para>
        /// <para>An existing tile cache or a tile package from which the tiles are imported.</para>
        /// <para>从中导入切片的现有切片缓存或切片包。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Source Tile Cache")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_cache_source { get; set; }


        /// <summary>
        /// <para>Scales [Pixel Size] (Estimated Disk Space)</para>
        /// <para>A list of scale levels at which tiles will be imported.</para>
        /// <para>将导入切片的比例级别列表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Scales [Pixel Size] (Estimated Disk Space)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _scales { get; set; } = null;


        /// <summary>
        /// <para>Area of Interest</para>
        /// <para><xdoc>
        ///   <para>An area of interest will spatially constrain where tiles are imported into the cache.</para>
        ///   <para>This parameter is useful if you want to import tiles for irregularly shaped areas.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>感兴趣区域将在空间上限制切片导入缓存的位置。</para>
        ///   <para>如果要为形状不规则的区域导入切片，则此参数非常有用。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Area of Interest")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _area_of_interest { get; set; } = null;


        /// <summary>
        /// <para>Overwrite Tiles</para>
        /// <para><xdoc>
        ///   <para>Determines whether the images in the destination cache will be merged with the tiles from the originating cache or overwritten by them.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—When the tiles are imported, transparent pixels in the originating cache are ignored by default. This results in a merged or blended image in the destination cache. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—The import replaces all pixels in the area of interest, effectively overwriting tiles in the destination cache with tiles from the originating cache.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定目标缓存中的图像是与原始缓存中的切片合并还是被它们覆盖。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 导入切片时，默认情况下将忽略原始缓存中的透明像素。这会导致目标缓存中出现合并或混合的图像。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 导入将替换感兴趣区域中的所有像素，从而有效地将目标缓存中的切片覆盖为原始缓存中的切片。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Overwrite Tiles")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _overwrite_value _overwrite { get; set; } = _overwrite_value._false;

        public enum _overwrite_value
        {
            /// <summary>
            /// <para>OVERWRITE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("OVERWRITE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>MERGE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("MERGE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Updated Target Tile Cache</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Target Tile Cache")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_tile_cache { get; set; }


        public ImportTileCache SetEnv(object parallelProcessingFactor = null)
        {
            base.SetEnv(parallelProcessingFactor: parallelProcessingFactor);
            return this;
        }

    }

}